<%@ include file="/common/taglibs.jsp"%>

<title><fmt:message key="departmentDetail.title"/></title>
<content tag="heading"><fmt:message key="departmentDetail.heading"/></content>

<html:form action="saveDepartment" method="post" styleId="departmentForm" onsubmit="return validateDepartmentForm(this)">
<ul>

<html:hidden property="id"/>

    <li>
        <generalsetting:label styleClass="desc" key="departmentForm.deptId"/>
        <html:errors property="deptId"/>
        <html:text property="deptId" styleId="deptId" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="departmentForm.deptName"/>
        <html:errors property="deptName"/>
        <html:text property="deptName" styleId="deptName" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="departmentForm.deptEngName"/>
        <html:errors property="deptEngName"/>
        <html:text property="deptEngName" styleId="deptEngName" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="departmentForm.deptNamagerNo"/>
        <html:errors property="deptNamagerNo"/>
        <html:text property="deptNamagerNo" styleId="deptNamagerNo" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="departmentForm.deptLevel"/>
        <!-- html:errors property="deptLevel"/-->
        <!-- html:text property="deptLevel" styleId="deptLevel" styleClass="text medium"/-->
            <html:select property="deptLevel" onchange="">
            	<html:options collection="orglevelsettings" property="levelId" labelProperty="levelName"/>
            </html:select>
    </li>

    <li>
        <generalsetting:label styleClass="desc" key="departmentForm.upperDept"/>
        <!-- html:errors property="upperDept"/-->
        <!-- html:text property="upperDept" styleId="upperDept" styleClass="text medium"/-->
            <html:select property="upperDept" onchange="">
            	<html:options collection="departments" property="deptId" labelProperty="deptName"/>
            </html:select>
    </li>

    <li>
        <generalsetting:label styleClass="desc" key="departmentForm.companyId"/>
        <!-- html:errors property="companyId"/-->
        <!-- html:text property="companyId" styleId="companyId" styleClass="text medium"/-->
            <html:select property="companyId" onchange="">
            	<html:options collection="companys" property="companyId" labelProperty="companyName"/>
            </html:select>
    </li>

    <li>
        <generalsetting:label styleClass="desc" key="departmentForm.oldDeptId"/>
        <html:errors property="oldDeptId"/>
        <html:text property="oldDeptId" styleId="oldDeptId" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="departmentForm.costCenter"/>
        <html:errors property="costCenter"/>
        <html:text property="costCenter" styleId="costCenter" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="departmentForm.validDate"/>
        <html:errors property="validDate"/>
        <html:text property="validDate" styleId="validDate" styleClass="text medium"/>
            <A HREF="#" onclick="cal1.select(document.forms[0].validDate,'anchor1','yyyy/MM/dd');return false;"
                     title = "cal1.select(document.forms[0].validDate, 'anchor1', 'yyyy/MM/dd'); return false;"
                     id="anchor1" name="anchor1">                
            <fmt:message key="button.calendar"/>            
            </A>  
    </li>

    <li>
        <generalsetting:label styleClass="desc" key="departmentForm.invalidDate"/>
        <html:errors property="invalidDate"/>
        <html:text property="invalidDate" styleId="invalidDate" styleClass="text medium"/>
            <A HREF="#" onclick="cal1.select(document.forms[0].invalidDate,'anchor2','yyyy/MM/dd');return false;"
                     title = "cal1.select(document.forms[0].invalidDate, 'anchor2', 'yyyy/MM/dd'); return false;"
                     id="anchor2" name="anchor2">                
            <fmt:message key="button.calendar"/>            
            </A>  
    </li>

    <li>
        <generalsetting:label styleClass="desc" key="departmentForm.description"/>
        <html:errors property="description"/>
        <html:text property="description" styleId="description" styleClass="text medium"/>

    </li>
    	
    <li>
        <generalsetting:label styleClass="desc" key="departmentForm.groupId"/>
        <!-- html:errors property="groupId"/-->
        <!--html:text property="groupId" styleId="groupId" styleClass="text medium"/-->
            <html:select property="groupId" onchange="">
            	<html:options collection="groups" property="groupId" labelProperty="groupName"/>
            </html:select>
    </li>    	

    <li class="buttonBar bottom">
        <html:submit styleClass="button" property="method.save" onclick="bCancel=false">
            <fmt:message key="button.save"/>
        </html:submit>

        <html:submit styleClass="button" property="method.delete" onclick="bCancel=true; return confirmDelete('Department')">
            <fmt:message key="button.delete"/>
        </html:submit>

        <html:cancel styleClass="button" onclick="bCancel=true">
            <fmt:message key="button.cancel"/>
        </html:cancel>
    </li>
</ul>
</html:form>
<SCRIPT LANGUAGE="JavaScript" SRC="scripts/CalendarPopup.js"></SCRIPT>
<script type="text/javascript">
    var cal1 = new CalendarPopup();
//cal1.showNavigationDropdowns();
    cal1.showYearNavigation(); 
	cal1.showYearNavigationInput();
    
    Form.focusFirstElement($("departmentForm"));
</script>

<html:javascript formName="departmentForm" cdata="false" dynamicJavascript="true" staticJavascript="false"/>
<script type="text/javascript" src="<html:rewrite page="/scripts/validator.jsp"/>"></script>
